﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class UserControl_topmenu : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie _user = Request.Cookies["userinfo"];
        StringBuilder sb = new StringBuilder();
        sb.Append("<ul>");
        try
        {
            if (Request.Cookies["userinfo"] != null)
            {
                if (_user["username"] != null)
                {
                    sb.Append("<li><a href='" +ResolveUrl("~/Index.html")+"'>Danh bạ web</a></li>");
                    sb.Append("<li><a href='#'>Home Shopping</a></li>");
                    sb.Append("<li><a href='#'>Hỏi đáp trực tuyến</a></li>");
                    sb.Append("<li><a href='#'>Hướng dẫn</a></li>");
                    sb.Append("<li><a href='#'>Danh bạ web</a></li>");
                    sb.Append("<li><a href='" +ResolveUrl("~/"+_user["username"]) + "'>Profile</a></li>");
                }
                else
                {
                    sb.Append("<li><a href='" + ResolveUrl("~/Index.html") + "'>Danh bạ web</a></li>");
                    sb.Append("<li><a href='#'>Home Shopping</a></li>");
                    sb.Append("<li><a href='#'>Hỏi đáp trực tuyến</a></li>");
                    sb.Append("<li><a href='#'>Hướng dẫn</a></li>");
                    sb.Append("<li><a href='#'>Liên hệ</a></li>");
                }
            }
            else
            {
                sb.Append("<li><a href='" + ResolveUrl("~/Index.html") + "'>Danh bạ web</a></li>");
                sb.Append("<li><a href='#'>Home Shopping</a></li>");
                sb.Append("<li><a href='#'>Hỏi đáp trực tuyến</a></li>");
                sb.Append("<li><a href='#'>Hướng dẫn</a></li>");
                sb.Append("<li><a href='#'>Liên hệ</a></li>");
            }
        }
        catch (Exception ex)
        {
        }
        sb.Append("</ul>");
        ltrtopmenu.Text = sb.ToString();
    }
}